<script type="text/x-handlebars-template">
	<table id="stagemonitor-calltree" class="table">
		<thead>
		<tr>
			<th>Signature</th>
			<th class="stagemonitor-calltree-executiontime">
				Total time (ms)
				<span class="tip glyphicon glyphicon-question-sign" data-toggle="tooltip" data-placement="left" title="Total time of method call (including children)"></span>
			</th>
			<th class="stagemonitor-calltree-executiontime">
				Self time (ms)
				<span class="tip glyphicon glyphicon-question-sign" data-toggle="tooltip" data-placement="left" title="Time spent within the method itself (excluding children)"></span>
			</th>
		</tr>
		</thead>
		<tbody>
		{{#each callTreeRows}}
		<tr class="{{#if executionTimeExceededThreshold}}warning{{/if}}" data-tt-expanded="{{#if anyChildExceedsThreshold}}true{{else}}false{{/if}}" data-tt-parent-id="{{parentId}}" data-tt-id="{{myId}}">
			<td class="stagemonitor-calltree-signature">
				{{{wrapWithinPreIfIoQuery ioQuery shortSignature signature}}}
				{{#unless ioQuery}}
					<span class="wide-tooltip">
						<span class="tip glyphicon glyphicon-question-sign" data-toggle="tooltip" data-placement="right" title="{{signature}}">
						</span>
					</span>
					{{#if queryCount}}
						<div class="label label-primary query-count" style="display:{{#if anyChildExceedsThreshold}}none{{else}}inline{{/if}}">
							{{queryCount}} {{#ifCond queryCount '>' 1}}Queries{{else}}Query{{/ifCond}}
						</div>
					{{/if}}
				{{/unless}}
			</td>
			{{#ifCond executionTimeInNs '>' 0 }}
				<td><div class="progress"><div class="progress-bar" style="width: {{executionTimePercent}}%">{{executionTimeInMs}}</div></div></td>
				<td><div class="progress"><div class="progress-bar" style="width: {{selfExecutionTimePercent}}%">{{selfExecutionTimeInMs}}</div></div></td>
			{{else}}
				<td></td>
				<td></td>
			{{/ifCond}}
		</tr>
		{{/each}}
		</tbody>
	</table>
</script>